<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>name</title>

    <!-- 引入样式 -->

    <link rel="stylesheet" href="../plugins/elementui/index.css">

    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="../css/style.css">

</head>
<body>

<div id="app">
    <div align="center">
        <form action="http://localhost/getUser" method="get" id="form">

            <input type="hidden" name="username" value="">

            <p></p>

            <input type="submit" value="查看">
        </form>
    </div>
</div>

<!--引入组件库-->
<script src="../js/vue.js"></script>

<script src="../plugins/elementui/index.js"></script>

<script type="text/javascript" src="../js/jquery.min.js"></script>

<script src="../js/axios-0.18.0.js"></script>

<script>
    new Vue({
        el: "#app",
        data:{
            user:{
                uid:'',
                username:'',
                password:'',
                sex:'',
                address:'',
                telephone:''
            }
        },

        //钩子函数，VUE对象初始化完成后自动执行
        created() {
            this.getFormData();
        },

        methods:{
            //初始化表单数据
            getFormData() {
                axios.get("/network/visit/getSession").then((res)=>{
                    var list = '<input type="hidden" name="username" value="'+res.data.data.username+'">\n' +
                        '\n' +
                        '            <p></p>\n' +
                        '\n' +
                        '            <input type="submit" value="查看">';
                    $("#form").html(list);
                });
            },
        }
    })
</script>
</body>
</html>